<!DOCTYPE HTML>  
<html>  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>JavaScript异常捕获</title>  
<script type="text/javascript">   
function fun(){
try{ 
t; 
}catch(error){ 
console.log(error.message);//t is not defined 
console.log(error.name);//ReferenceError
}
}
fun();
</script>  
</head>  
<body>  
</body>  
</html>